
def run(params:list[str]):
    from ApiTools import apiBase,apiTools
    vectdb = apiTools.load_vec()
    collect = apiBase.argv(params,1,"act/plan/tablename")
    #print("collect="+collect)
    task = apiBase.argv(params,2,"Thomas, Toby, and Rebecca worked a total of 157 hours in one week. Thomas worked x hours. Toby worked 10 hours less than twice what Thomas worked, and Rebecca worked 8 hours")
    plan=f'''Plan: Given Thomas worked x hours, translate the problem into algebraic expressions and solve
with Wolfram Alpha. #E1 = WolframAlpha[Solve x + (2x − 10) + ((2x − 10) − 8) = 157]
Plan: Find out the number of hours Thomas worked. #E2 = LLM[What is x, given #E1]
Plan: Calculate the number of hours Rebecca worked. #E3 = Calculator[(2 ∗ #E2 − 10) − 8]'''
    a = apiBase.argv(params,3,plan)
    a=f"Task: {task}\n{a}"
    key = apiBase.argv(params,4,'')
    vectdb.train_QA(collect_name=collect,question=task,sql=a,key=key,fun_name="act-relate")
    return "load related ok"

#run([])